const REG_USERNAME = /^[a-zA-Z][a-zA-Z0-9_]{2,19}$/;
const REG_LENGTH = /^.{3,20}$/;
const REG_CHARACTER = /^[A-Za-z0-9_]+$/;
const REG_FIRST = /^[A-Za-z].*/;

class LegalUtil {
  static checkUsername(username: string) {
    return REG_USERNAME.test(username);
  }
  static checkLength(username: string) {
    return REG_LENGTH.test(username);
  }
  static checkCharacter(username: string) {
    return REG_CHARACTER.test(username);
  }
  static checkFirst(username: string) {
    return REG_FIRST.test(username);
  }
}
export default LegalUtil;
